import request from "@/utils/request";
import type {LoginResponse,GetUserInfoResponse} from "./model/loginModel"
enum Api{
  // POST /admin/acl/index/login
  LoginUrl="/admin/acl/index/login",
  InfoUrl="/admin/acl/index/info",
  logoutUrl = "/admin/acl/index/logout",
}

export const LoginApi=(username: string, password: string)=>{
  return request.post<any,LoginResponse>(Api.LoginUrl,{
    username,
    password
  })
}
export  const InfoApi=()=>{
  return request.get<any,GetUserInfoResponse>(Api.InfoUrl)
}
/**
 * 退出登录
 *
 */
 export const logoutApi = () => {
  return request.post<any, null>(Api.logoutUrl);
};